home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Wonky Flux Batch 2019 02
/
Wonky_Flux_Batch_2019-02.zip
/
Wonky Flux Batch 2019-02
/
089 - Misc Stuff - PD.dsk
/
UPCON.S
< prev
next >
Wrap
Text File
|
2019-02-17
|
2KB
|
87 lines
********************************
* *
* UPCON by Glen E. Bredon *
* *
********************************
* *
* Takes a MERLIN source file *
* and converts all lower case *
* comments commencing with "*" *
* or " ;" to upper case. *
* *
********************************
* *
* With source file in memory *
* BRUN UPCON from EXEC mode. *
* *
********************************
PL = 0
SOURCE = $A
ENDSRC = $E
********************************
DO 0
INCR MAC
INC ]1
BNE NI
INC ]1+1
NI <<<
TRDB MAC
LDA ]1
STA ]2
LDA ]1+1
STA ]2+1
<<<
FIN
********************************
ORG $280
>>> TRDB.SOURCE;PL
LDY #0
FIRSTCHR LDA (PL),Y ;Get 1st character on line
CMP #"*" ;Check if whole line a comment
BEQ COMMENT
CMP #" ;"
BEQ COMMENT
GOTHRU JSR GETBYTE ;Otherwise, look for " ;"
SPACE? CMP #" "
BNE GOTHRU
JSR GETBYTE
CMP #" ;"
BNE SPACE?
COMMENT JSR GETBYTE ;Now we are in comment,
CMP #%11100000 ; so change all lower case
BLT COMMENT ; to upper case.
AND #%11011111
STA (PL),Y ;Put it back
BNE COMMENT ;Loop till at end of line
GETBYTE >>> INCR.PL
JSR DONE? ;Check if through source
LDA (PL),Y ;Get character
CMP #$8D ;Is it end of line?
BNE BACK ;Return if not
PLA ;Pop return adrs
PLA
>>> INCR.PL ;Point to next char
JSR DONE? ; and check if done
BLT FIRSTCHR ;Loop till done
DONE? LDA PL ;Compare PL to
CMP ENDSRC ; end of source
LDA PL+1
SBC ENDSRC+1
BLT BACK ;Return if not done
PLA ;Pop 2 addresses
PLA ; from stack
PLA ; and return
PLA ; to caller.
BACK RTS